FROM python:3.10

# install deps
RUN apt-get update --fix-missing && \
    apt-get install -yq build-essential cmake curl

# update pip and install jupyterlab
RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install jupyterlab plotly ipywidgets jupyterlab-dash

# disable ridiculous popup
RUN jupyter labextension disable "@jupyterlab/apputils-extension:announcements"

# create a user account to run under
RUN useradd -s /bin/bash -m developer
USER developer

# install rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

# install evcxr
ENV HOME=/home/developer
ENV CARGO_BIN="${HOME}/.cargo/bin"
RUN . "${HOME}/.cargo/env"
RUN export PATH="${HOME}/.cargo/bin:${PATH}"
RUN ${CARGO_BIN}/cargo install evcxr_jupyter --version 0.14.2
# RUN ${CARGO_BIN}/cargo install evcxr_jupyter --version 0.16.0
RUN ${CARGO_BIN}/evcxr_jupyter --install

CMD ["/bin/bash"]